import { createRouter, createWebHistory } from "vue-router";
let router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      //路由路径
      path: '/',
      component: () => import('../components/LoginView.vue')
    },
    {
      path: '/dashboard',
      component: () => import('../components/DashboardView.vue'),
      children: [{
        //子路由路径前面不能以斜杠开头
        path: '',
        component: () => import('../components/StsasticView.vue'),
      }, {
        //子路由路径前面不能以斜杠开头
        path: 'user',
        component: () => import('../components/UserView.vue'),
      },
      {
        //id是动态变量，这个叫动态路由
        path: 'user/:id',
        component: () => import('../components/UserDetailView.vue')
      },
      {
        //子路由路径前面不能以斜杠开头
        path: 'activity',
        component: () => import('../components/ActivityView.vue'),
      }, {
        //子路由路径前面不能以斜杠开头
        path: 'activity/add',
        component: () => import('../components/ActivityRecordView.vue'),
      }, {
        //子路由路径前面不能以斜杠开头
        path: 'activity/edit/:id',
        component: () => import('../components/ActivityRecordView.vue'),
      }, {
        //子路由路径前面不能以斜杠开头
        path: 'activity/:id',
        component: () => import('../components/ActivityDetailView.vue'),
      }, {
        //子路由路径前面不能以斜杠开头
        path: 'clue',
        component: () => import('../components/ClueView.vue'),
      },
      {
        //子路由路径前面不能以斜杠开头
        path: 'clue/add',
        component: () => import('../components/ClueRecordView.vue'),
      }, {
        //子路由路径前面不能以斜杠开头
        path: 'clue/edit/:id',
        component: () => import('../components/ClueRecordView.vue'),
      }, {
        //子路由路径前面不能以斜杠开头
        path: 'clue/detail/:id',
        component: () => import('../components/ClueDetailView.vue'),
      }, {
        //子路由路径前面不能以斜杠开头
        path: 'customer',
        component: () => import('../components/CustomerView.vue'),
      },
      {
        //子路由路径前面不能以斜杠开头
        path: 'customer/detail/:id',
        component: () => import('../components/CustomerDetailView.vue'),
      },
      {
        //子路由路径前面不能以斜杠开头
        path: 'tran',
        component: () => import('../components/TranView.vue'),
      }
      ]

    }
  ]

})
//default是范围
export default router;